package com.hanxiaozhang.api.fegin.base;

import com.hanxiaozhang.api.config.FeignHeaderConfig;
import com.hanxiaozhang.api.fegin.base.fallback.BaseFeignClientFallbackFactory;
import com.hanxiaozhang.base.entity.LogEntity;
import com.hanxiaozhang.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * 〈一句话功能简述〉<br>
 * 〈基础模块feign〉
 *
 * @author hanxinghua
 * @create 2021/4/8
 * @since 1.0.0
 */
@FeignClient(name = "hanxiaozhang-base",
        configuration = {FeignHeaderConfig.class},
        fallbackFactory = BaseFeignClientFallbackFactory.class)
public interface BaseFeignClient {

    @PostMapping("/log/save")
    Result<Void> save(@RequestBody LogEntity logEntity);


    @PostMapping("/file/uploadFile")
    Result uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("type") String type, @RequestParam("fileTag") String fileTag);

}